package com.xxx.dao;

import com.xxx.pojo.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/8/18 14:25
 * @Copyright 博为峰
 */
@Repository("accountDao")
public class AccountDaoImpl implements AccountDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void updateAccount(String name, int money) {
        jdbcTemplate.update("update account set balance = balance + ? where name = ?", money, name);
    }
}
